package org.novudu.presentation.actions;

import java.net.URL;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.update.core.IFeature;
import org.novudu.presentation.NovuduEditorPlugin;

public class FeatureLabelProvider extends LabelProvider {
	
	static Image image = ImageDescriptor.createFromURL((URL) NovuduEditorPlugin.INSTANCE.getImage("full/obj16/Feature.gif")).createImage();
	
	@Override
	public Image getImage(Object element) {
		return image;
	}
	
	@Override
	public String getText(Object element) {
		String text;
		IFeature feature = (IFeature) element;
		text = feature.getVersionedIdentifier().getIdentifier() + " " + feature.getVersionedIdentifier().getVersion().toString();
		return text;
	}
	
}
